$actualDir = Get-Location
$dir = $env:windir + "\system32\inetsrv"

Set-Location $dir
$handlers = .\appcmd.exe list config /section:system.webServer/handlers

$found = $FALSE;

foreach($handler in $handlers)
{
	if($handler.ToString().Contains("*.php") -and $handler.ToString().Contains("php-cgi.exe"))
    {       
       $found = $TRUE;
       break;
    }
}

Set-Location $actualDir
$found;